/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.jm.financeiro.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "carga", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Carga.findAll", query = "SELECT c FROM Carga c")})
public class Carga implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "carga_id_carga_seq")
    @SequenceGenerator(name = "carga_id_carga_seq", sequenceName = "carga_id_carga_seq", initialValue = 1, allocationSize = 1)
    @Basic(optional = false)
    @Column(name = "id_carga", nullable = false)
    private Integer idCarga;
    @Size(max = 100)
    @Column(name = "dsc_carga", length = 100)
    private String dscCarga;
    @Column(name = "dat_carga")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datCarga;

    public Carga() {
    }

    public Carga(Integer idCarga) {
        this.idCarga = idCarga;
    }

    public Integer getIdCarga() {
        return idCarga;
    }

    public void setIdCarga(Integer idCarga) {
        this.idCarga = idCarga;
    }

    public String getDscCarga() {
        return dscCarga;
    }

    public void setDscCarga(String dscCarga) {
        this.dscCarga = dscCarga;
    }

    public Date getDatCarga() {
        return datCarga;
    }

    public void setDatCarga(Date datCarga) {
        this.datCarga = datCarga;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCarga != null ? idCarga.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Carga)) {
            return false;
        }
        Carga other = (Carga) object;
        if ((this.idCarga == null && other.idCarga != null) || (this.idCarga != null && !this.idCarga.equals(other.idCarga))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.Carga[ idCarga=" + idCarga + " ]";
    }
    
}
